package kr.hkit.powerjava.s;

class Box{
	// 필드 정의
	int width;  //가로
	int length;  //세로
	int height;  //높이
	//메소드 정의
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	int getVolume(){
		System.out.println(width*length*height);
		return width*length*height;
	}
	void print(){
		System.out.println("가로 : "+width+" 세로 : "+length+" 높이 : "+height);
	}

}


public class BoxTest {
	public static void main(String[] args) {
		Box box1;
		box1 = new Box();
		
		box1.setWidth(100);
		box1.setLength(100);
		box1.setHeight(100);
		
		box1.getVolume();
		
		Box box2 = new Box();
			
		box2.setHeight(200);
		box2.setLength(200);
		box2.setWidth(200);
		box2.getVolume();
		
		box1=box2;
		
		box1.print();
	}

}
